﻿@namespace SwashbucklerDiary.Components
@inherits DialogComponentBase

<MMDialog MyValue="Value"
          MyValueChanged="InternalValueChanged"
          MaxWidth="420">
    <MCard Rounded="@("lg")">
        <MCardTitle Class="font-weight-bold">
            @(I18n.T("About.Sponsor.Name"))
            <MSpacer></MSpacer>
            <MButton Icon="true"
                     OnClick="HandleOnCancel">
                <MIcon>mdi-close</MIcon>
            </MButton>
        </MCardTitle>
        <MCardText Class="pb-0">
            <MChipGroup @bind-Value="selection"
                        Mandatory="true"
                        ActiveClass="primary--text">
                @foreach (var item in Amounts)
                {
                    <MChip Outlined="true"
                           Filter="true">
                        @(I18n.T("Amount.CurrencySymbol") + item)
                    </MChip>
                }
                <MChip Outlined="true"
                       Filter="true">
                    <MIcon>
                        mdi-pencil-outline
                    </MIcon>
                </MChip>
            </MChipGroup>
            @if (ShowCustomAmount)
            {
                <MTextField Value="55"
                            TValue="int"
                            Type="number"
                            Outlined
                            Dense
                            HideDetails="@("auto")"
                            Placeholder="@(I18n.T("Amount.CustomPlace"))"
                            Prefix="$"
                            NumberProps="@(prop=> { prop.Min = 10; prop.HideControl = true; })">
                </MTextField>
            }
        </MCardText>
        <MCardActions>
            <MSpacer></MSpacer>
            <MButton Text OnClick="HandleOnCancel">
                @(I18n.T("Share.Cancel"))
            </MButton>
            <MButton Text
                     Color="primary"
                     OnClick="OnSponsor">
                @(I18n.T("Share.OK"))
            </MButton>
        </MCardActions>
    </MCard>
</MMDialog>

<MMDialog @bind-MyValue="ShowThank" MaxWidth="420">
    <MCard Rounded="@("lg")">
        <MCardTitle Class="font-weight-bold">
            @(I18n.T("Amount.Thank"))
            <MSpacer></MSpacer>
            <MButton Icon OnClick="()=>ShowThank=false">
                <MIcon>mdi-close</MIcon>
            </MButton>
        </MCardTitle>
        <MCardText Style="white-space:pre-line;">
            @(I18n.T("Amount.ThankContent"))
        </MCardText>
    </MCard>
</MMDialog>